package com.hello.ATM;

import java.util.Scanner;

public class Login {
    int password;
    Function function=new Function(10000);
    Login(int p) {
        password = p;
    }

    void pasd() {
        System.out.println("请输入密码");
        Scanner in = new Scanner(System.in);
        for (int i = 0; i < 3; i++) {
            if(i > 0){
                System.out.println("想要登录请输出密码");
            }
            int psd = in.nextInt();
            boolean f = false;
            if (psd == password) {
                f = true;
                System.out.println("欢迎登录工行系统");
                function.print();

            } else {
                if (2 - i != 0) {
                    System.out.println("密码错误，您还有" + (2 - i) + "次输入机会");
                } else {
                    System.out.println("您的密码错误，3次机会已用完，请至柜台重置密码，谢谢！");
                }
            }

        }

    }
}